package com.neouton.crm.paymentPlan.mapper;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.crm.entity.SysUserEntity;
import com.neouton.crm.paymentPlan.entity.PaymentPlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author Mose
* @description 针对表【payment_plan(付款计划)】的数据库操作Mapper
* @createDate 2023-01-12 16:25:52
* @Entity generator.domain.PaymentPlan
*/
@Mapper
public interface PaymentPlanMapper  {


    List<PaymentPlan> getPayPlanList(@Param("vo")PaymentPlan entity);

    boolean updatePayPlanById(@Param("vo")PaymentPlan entity);

    boolean savePayPlan(@Param("List") List<PaymentPlan> paymentPlans);

    List<PaymentPlan> getPayPlanListBypurchaseOrderIds(List<Integer> poIds);
    //供应商视图接口查询
    List<PaymentPlan> getPayPlanListBypurchaseOrderIdAndSupplierId(@Param("poIds")List<Integer> poIds, @Param("supplierId")Integer supplierId);

    PaymentPlan queryPaymentPlanByPurchaseOrderID(@Param("vo")PaymentPlan paymentPlan);

    List<PaymentPlan> getPaymentPlanByPurchaseOrderID(@Param("vo")PaymentPlan paymentPlan);

    void updatePayPlanByIds(@Param("List")List<PaymentPlan> paymentPlans,@Param("purchaseId") Integer purchaseId);

    void backUpPayPlan(@Param("purchaseOrderId") Integer purchaseId,@Param("backUserId")Integer userId);

    /**
     * 分页查询回款计划
     *
     * @param page
     * @param entity
     * @return
     */
    IPage<PaymentPlan> queryPaymentPlansByPage(@Param("page") IPage page,
                                               @Param("vo") PaymentPlan entity,
                                               @Param("userList") List<SysUserEntity> userList);

    /**
     * 分页查询回款计划
     *
     * @param entity
     * @return
     */
    List<PaymentPlan> queryAllPaymentPlans(@Param("vo") PaymentPlan entity,
                                           @Param("userList") List<SysUserEntity> userList);

    List<PaymentPlan> queryPayPlanByPidAndPlanPeriod(@Param("vo") PaymentPlan paymentPlan);

    void updatePayPlansByIdAndPlanPeriod(@Param("list")List<PaymentPlan> paymentPlans);

    List<PaymentPlan> queryPayPlanBackByPidAndPlanPeriod(@Param("vo") PaymentPlan paymentPlan);
}
